﻿using MediatR;
using T_Rbac.Read.APi.Application.Command.Jobs;
using T_Rbac_Demain;
using T_Rbac_Rep.Interface;

namespace T_Rbac.Read.APi.Application.Handlers.JobsHandlers
{
    public class JobListSearchHandlers : IRequestHandler<JobListCommand, List<Job>>
    {
        private readonly IjobRep ijobRep;

        public JobListSearchHandlers(IjobRep ijobRep)
        {
            this.ijobRep = ijobRep;
        }

        public async Task<List<Job>> Handle(JobListCommand request, CancellationToken cancellationToken)
        {
            var list = await ijobRep.GetvaluesByResult(x => x.IsDel == false);
            return list.ToList();
        }
    }
}
